<?php

namespace html\core;

class style extends \system\core\abstractAttribute
{

	private $namespace;

	function __construct($keyvaluepair, $namespace="")
	{
		$pair = explode(":", $keyvaluepair, 2);
		$pair[0] = trim($pair[0]);
		$pair[1] = trim(@$pair[1]);
		if(substr($pair[1],-1,1) == ";") $pair[1] = substr($pair[1],0,-1);

		$this->setKey($pair[0]);
		$this->setValue($pair[1]);
		$this->setSeparator(": ");
		$this->setNamespace($namespace);
		$this->setAttributeEnd(";");

		return $this;
	}

	function setNamespace($string)
	{
		$this->namespace = $string;
	}

	function getNamespace()
	{
		return $this->namespace;
	}

}

?>
